package com.ea.admin.mapper;

import com.ea.admin.pojo.dto.DepartmentDto;
import com.ea.admin.pojo.po.AdminDeptPermission;
import com.ea.admin.pojo.vo.account.ContactAdminVo;
import com.ea.common.mybatis.EmoAnalyBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AdminDeptPermissionMapper extends EmoAnalyBaseMapper<AdminDeptPermission> {
    List<DepartmentDto> getAllDeptList(
            @Param("accountId") Long accountId,
            @Param("companyIdList") List<Long> companyIdList,
            @Param("supDeptId") Long supDeptId
    );

    List<ContactAdminVo> getAllAdminInfoByCompanyIdAndName(
            @Param("companyId") Long companyId,
            @Param("contactName") String contactName
    );

    int getMinLevelByAccountId(
            @Param("accountId") Long accountId
    );

    void deleteDuplicateDeptPermission(
            @Param("deptId") Long deptId
    );

    List<Long> getSubDepartmentIdList(
            @Param("accountId") Long accountId,
            @Param("companyIdList") List<Long> companyIdList,
            @Param("deptIdList") List<Long> deptIdList
    );
    List<Long> getCompanyIdListByAccountId(
            @Param("accountId") Long accountId
    );
}
